<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>ChangeCourse_Page</title>
<script src="../jquery-3.5.1.js"></script>
<script src="../jquery.cookie.js"></script>
<script>
	var userid = sessionStorage.getItem('testKey');
	console.log(userid);
	if (userid == null || userid == "") {
		window.location = "/login.html";
	}
</script>
<style>
body {
	font-size: 75%;
	font-family: verdana, arial, 'sans serif';
	background-repeat: repeat-x;
	background-color: #FFFFF0;
}

h1 {
	font-size: 200%;
}

h2 {
	font-size: 140%;
}

h3 {
	font-size: 110%;
}

th {
	background-color: #ADD8E6;
}

ol {
	list-style: upper-roman;
}

ul {
	list-style-type: none;
	margin: 0;
	padding: 0;
	overflow: hidden;
	background-color: #333;
}

li {
	float: left;
}

li a {
	display: block;
	color: white;
	text-align: center;
	padding: 14px 16px;
	text-decoration: none;
}

li a:hover {
	background-color: #111;
}

.active {
	background-color: #bfbfbf;
}

.foot {
	position: fixed;
	bottom: 5px;
	text-align: center;
	padding: 10px;
	border-radius: 6px;
	background-image: linear-gradient(to bottom right, #ffb21a, #ffdd99);
}
</style>

<script type="text/javascript">
	var url = decodeURI(window.location.href);
	var argsIndex = url.split("?courseTchId=");
	var cid = argsIndex[1];
	window.onload = function() {
		$.ajax({
				
			type : 'GET',
			url :"/courseSelectionByCTId/"+cid,
			contentType : "application/json;cherset=utf-8",
			
			success : function(data) {
				console.log(data);
				var InData=data;
                var html = "";
				for(var i=0;i<data.length;i++){
					html +="<tr>";
  					html +=		"<td>" + data[i].courseTeaching.course.name +"</td>";
  					html +=		"<td>" + data[i].student.name+"</td>";
  					html +=		"<td>" + data[i].student.sid +"</td>";
  					html +=		"<td>" + data[i].courseTeaching.course.credit +"</td>";
  					html +=		"<td><a href='AddScore.html?courseTchId="+data[i].id+"'>开始录入分数</a></td>"
  					html +="</tr>";
				}
				$("#inTable").html(html); 
			},
			error : function(data) {
				alert("error:" + JSON.stringify(data));
			}
		});

	}
</script>

</head>
<body>
	<ul><!--导航栏 -->
  <li><a href="TeacherPage.html">主页</a></li>
  <li><a href="TchCourses.html">查看所教课程</a></li>
  <li><a class="active" href="LoggingScore.html">分数录入</a></li>
  <li><a href="AddCourse.html">增加课程</a></li>
  <li style="float:right"><a href="">修改密码</a></li>
  
</ul>
<br/>
	<em>选择一个学生进行分数录入</em>
<table >
             <thead>
                <tr>
                    <th>课程名称</th>
                    <th>学生姓名</th>
                    <th>学生学号</th>
                    <th>课程学分</th>
                    <th></th>                  
                    
         
                 </tr>
              </thead>
 
              <tbody  id="inTable">
              
              </tbody>
</table>
</body>
</html>